<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/static/easyui/themes/default/easyui.css">
<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/static/easyui/themes/icon.css">
<script type="text/javascript" src="${pageContext.request.contextPath}/static/easyui/jquery.min.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/static/easyui/jquery.easyui.min.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/static/easyui/locale/easyui-lang-zh_CN.js"></script>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>待办管理</title>
</head>
<body>
<table id="daiBanTable" fit="true"></table>
</body>
<script type="text/javascript">
$(function(){
	$("#daiBanTable").datagrid({
		url:"${pageContext.request.contextPath}/getDaiBanTaskByPage",
		title:"待办管理",
		toolbar:"#tb",
		fitColumns:true,
		rownumbers:true,
		pagination:true,
		singleSelect:true,
		columns:[[
			{field:'ck',checkbox:"true"},
			{field:"taskId",title:"任务Id",width:2,align:"center"},
			{field:"taskName",title:"任务名称",width:3,align:"center"},
			{field:"createTime",title:"创建时间",width:2,align:"center"},
			{field:"leaveOperation",title:"操作",width:3,align:"center",formatter:leaveOperation},
		]]
	})
	
	window.top["reload_daiBanTable"]=function(){
		$("#daiBanTable").datagrid( "load");
	};	
	
})

function leaveOperation(value,row){
		return "<a href='javascript:handleTask("+row.taskId+")'>办理任务</a>&nbsp;&nbsp;<a href='#'>查看当前流程图</a>";
}

function handleTask(id){
	//获取到父级对象
	var jq = top.jQuery;    
    if (jq("#myTabs").tabs('exists', "办理任务")){    
        jq("#myTabs").tabs('select', "办理任务");    
    } else {  
        var content = "<iframe scrolling='auto' frameborder='0'  src='${pageContext.request.contextPath}/banliTask?taskId="+id+"' style='width:100%;height:100%;'></iframe>";     
        jq("#myTabs").tabs('add',{    
                            title:"办理任务",    
                            content:content,    
                            closable:true    
                          });    
     }  
	
	
}





</script>
</html>